<template>
  <component :is="dynaComp" :currCfg="currCfg"/>
</template>

<script>

import {fieldMap} from "@/fields/menu";

export default {
  name: "ConfigBox",
  components: {},
  props:["currCfg"],
  data() {
    return {};
  },
  computed: {
    dynaComp() {
      if (this.currCfg) {
        return fieldMap.get(this.currCfg.type).config
      }
      return null;
    }
  },
  methods: {},
  mounted() {

  }
}
</script>,
<style lang="scss" scoped>
.field-item {
  padding: 10px;
  margin-bottom: 0;
  border: 1px dashed transparent;

  &.is-curr {
    border-color: #797979;
    background: #f2f2f2;
  }

  .item-main {
    display: flex;
    justify-content: space-between;

    .item-view {
      flex: 1;
      margin-right: 10px;
    }
  }
}
</style>
